package com.zxl.grocery.modular.schedule.controller;

import com.zxl.grocery.common.controller.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 爬虫定时控制器
 *
 * @author zxl
 * @Date 2017-08-24 10:27:44
 */
@Controller
@RequestMapping("/crawlerTask")
public class CrawlerTaskController extends BaseController {

    private String PREFIX = "/schedule/crawlerTask/";

    /**
     * 跳转到爬虫定时首页
     */
    @RequestMapping("")
    public String index() {
        return PREFIX + "crawlerTask.html";
    }

    /**
     * 跳转到添加爬虫定时
     */
    @RequestMapping("/crawlerTask_add")
    public String crawlerTaskAdd() {
        return PREFIX + "crawlerTask_add.html";
    }

    /**
     * 跳转到修改爬虫定时
     */
    @RequestMapping("/crawlerTask_update/{crawlerTaskId}")
    public String crawlerTaskUpdate(@PathVariable Integer crawlerTaskId, Model model) {
        return PREFIX + "crawlerTask_edit.html";
    }

    /**
     * 获取爬虫定时列表
     */
    @RequestMapping(value = "/list")
    @ResponseBody
    public Object list(String condition) {
        return null;
    }

    /**
     * 新增爬虫定时
     */
    @RequestMapping(value = "/add")
    @ResponseBody
    public Object add() {
        return super.SUCCESS_TIP;
    }

    /**
     * 删除爬虫定时
     */
    @RequestMapping(value = "/delete")
    @ResponseBody
    public Object delete() {
        return SUCCESS_TIP;
    }


    /**
     * 修改爬虫定时
     */
    @RequestMapping(value = "/update")
    @ResponseBody
    public Object update() {
        return super.SUCCESS_TIP;
    }

    /**
     * 爬虫定时详情
     */
    @RequestMapping(value = "/detail")
    @ResponseBody
    public Object detail() {
        return null;
    }
}
